<template>
<div class="echarts">
  <div :style="{ width: chartWidth, height: chartHeight }" class="no-data" v-if="this.chartData.rows && this.chartData.rows.length == 0">
    <span>画图展无数据</span>
  </div>
  <div ref="waterfall" :style="{ width: chartWidth, height: chartHeight }"></div>
</div>
</template>

<script>
import OptionWaterfall from './../echarts-js/echarts-waterfall'
import echartsMixin from './../echarts-js/echarts-mixin'
export default {
  mixins: [echartsMixin],
  mounted() {
    //调用初始化画图函数
    this.initChart()
  },
  methods: {
    initChart() {
      let theme = ''
      if (this.settings.theme) {
        theme = this.settings.theme
      }
      //设置画图对象
      this.myChart = this.$echarts.init(this.$refs.waterfall, theme)
      console.log(this.$props)
      //设置OptionBar对象
      const waterfall = new OptionWaterfall(this.chartData, this.settings, this.extend)
      //开始画图
      console.log(waterfall.option)
      this.myChart.setOption(waterfall.option)
    },
  }
}
</script>

<style>
</style>
